package org.jc.reflect.model;

public class JMethod {

	private String name;
	private Class<?>[] paramTypes;

	@SuppressWarnings("unused")
	private JMethod() {
	}

	public JMethod(String name, Class<?>[] paramTypes) {
		super();
		this.name = name;
		this.paramTypes = paramTypes;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Class<?>[] getParamTypes() {
		return paramTypes;
	}

	public void setParamTypes(Class<?>[] paramTypes) {
		this.paramTypes = paramTypes;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("{");
		sb.append("\"name\":");
		sb.append("\"");
		sb.append(name);
		sb.append("\"");
		sb.append(", \"paramTypes\":");
		sb.append("[");
		if (null != this.paramTypes && this.paramTypes.length > 0) {
			for (int i = 0,len = this.paramTypes.length; i < len; i++) {
				if (i > 0) {
					sb.append(", ");
				}
				sb.append("\"");
				sb.append(this.paramTypes[i].toString());
				sb.append("\"");
			}
		}
		sb.append("]");
		sb.append("}");
		return sb.toString();
	}

}
